<!-- 标准主页 -->

<template>
  <EasyScroll class="HomeStandard" full>
    <div
      v-for="(major, i) in CORE.MENU.TREE"
      :key="major.id"
      class="HomeStandard-major"
      :class="{ 'HomeStandard-major-last': i === CORE.MENU.TREE.length - 1 }"
    >
      <b>{{ major.name }}</b>

      <div v-for="minor in major.children" :key="minor.id" class="HomeStandard-major-minor" @click="toClick(minor)">
        <b>{{ minor.name }}</b>

        <span class="floatRight">
          <i v-if="/^el-icon/.test(minor.icon)" :class="minor.icon" />
          <CommonSvg v-else :src="CORE.image(minor.icon)" />
        </span>

        <div class="ellips">{{ minor.remark }}</div>
      </div>
    </div>
  </EasyScroll>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'

// ============================== 导出组件 ============================== //

export default CORE.extend({}, {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'HomeStandard',

  /**
   * 本地方法 (轻量重要在前)
   */
  methods: {
    /**
     * 点击
     */
    toClick({ describe: name }) {
      this.$router.push({ name })
    },
  },
})
</script>

<style lang="scss">
@import './index.scss';
</style>
